package com.example.demo.service.ServiceImpl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.bean.Dianzan;
import com.example.demo.mapper.DianzanMapper;
import com.example.demo.service.DianzanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author liaoxh
 * @create 2021-06-22-11:23
 */
@Service
public class DianzanServiceImpl extends ServiceImpl<DianzanMapper,Dianzan> implements DianzanService{
    @Autowired
    DianzanService dianzanService;
    @Override
    public Dianzan getByPUId(Integer userId, Integer pictureId) {
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("userId", userId);
        wrapper.eq("pictureId", pictureId);
        Dianzan dianzan = dianzanService.getOne(wrapper);
        return dianzan;
    }
}
